#ifndef TEXTCAPTURE_H
#define TEXTCAPTURE_H

#pragma once

#include <QObject>
#include <Windows.h>

class TextCapture : public QObject {
    Q_OBJECT
public:
    explicit TextCapture(QObject* parent = nullptr);
    ~TextCapture();

signals:
    void textCaptured(const QString& text);  // 文字捕获信号

private:
    static HHOOK m_mouseHook;               // 全局鼠标钩子句柄
    static bool m_isDragging;               // 标记是否正在拖动
    static TextCapture* m_receiver;             // 接收信号的Qt对象
    static POINT m_dragStartPos;            // 拖动起始位置

    // 鼠标钩子回调函数
    static LRESULT CALLBACK MouseProc(int nCode, WPARAM wParam, LPARAM lParam);
};

#endif // TEXTCAPTURE_H
